package com.lxx.modules.sys.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.lxx.common.BaseEntity;

/**
 *  实体类
 *
 * @author lxx
 */
public class SysDict extends BaseEntity<Integer>  {
	private static final long serialVersionUID = -2230520976040873757L;

	/** 查询字段 */
	@NotBlank
	@Size(min=2, max=30)
    private String queryCode;

    /** 字典项代码 */
	@NotBlank
	@Size(max=30)
    private String itemCode;

    /** 字典项名称 */
	@NotBlank
	@Size(max=30)
    private String itemName;

    /**
     * 返回 查询字段
     *
     * @return 查询字段
     */
    public String getQueryCode() {
        return queryCode;
    }

    /**
     * 设置 查询字段
     *
     * @param queryCode 查询字段
     */
    public void setQueryCode(String queryCode) {
        this.queryCode = queryCode == null ? null : queryCode.trim();
    }

    /**
     * 返回 字典项代码
     *
     * @return 字典项代码
     */
    public String getItemCode() {
        return itemCode;
    }

    /**
     * 设置 字典项代码
     *
     * @param itemCode 字典项代码
     */
    public void setItemCode(String itemCode) {
        this.itemCode = itemCode == null ? null : itemCode.trim();
    }

    /**
     * 返回 字典项名称
     *
     * @return 字典项名称
     */
    public String getItemName() {
        return itemName;
    }

    /**
     * 设置 字典项名称
     *
     * @param itemName 字典项名称
     */
    public void setItemName(String itemName) {
        this.itemName = itemName == null ? null : itemName.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", queryCode=").append(queryCode);
        sb.append(", itemCode=").append(itemCode);
        sb.append(", itemName=").append(itemName);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysDict other = (SysDict) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getQueryCode() == null ? other.getQueryCode() == null : this.getQueryCode().equals(other.getQueryCode()))
            && (this.getItemCode() == null ? other.getItemCode() == null : this.getItemCode().equals(other.getItemCode()))
            && (this.getItemName() == null ? other.getItemName() == null : this.getItemName().equals(other.getItemName()))
            && (this.getDelFlag() == null ? other.getDelFlag() == null : this.getDelFlag().equals(other.getDelFlag()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getQueryCode() == null) ? 0 : getQueryCode().hashCode());
        result = prime * result + ((getItemCode() == null) ? 0 : getItemCode().hashCode());
        result = prime * result + ((getItemName() == null) ? 0 : getItemName().hashCode());
        result = prime * result + ((getDelFlag() == null) ? 0 : getDelFlag().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }
}